package io.renren.modules.erp.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.erp.dao.BaseParamDao;
import io.renren.modules.erp.dao.BusinessBillDao;
import io.renren.modules.erp.entity.BusinessBillEntity;
import io.renren.modules.erp.service.BusinessBillService;


@Service("businessBillService")
public class BusinessBillServiceImpl extends ServiceImpl<BusinessBillDao, BusinessBillEntity> implements BusinessBillService {

	@Autowired
    private BusinessBillDao businessBillDao;
	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<BusinessBillEntity> page = this.selectPage(
                new Query<BusinessBillEntity>(params).getPage(),
                new EntityWrapper<BusinessBillEntity>()
        );

        return new PageUtils(page);
    }

	@Override
	public List<BusinessBillEntity> listbybill(Map<String, Object> params) {
		Long businessBillInfoId=Long.parseLong(params.get("businessBillInfoId")+"");
		List<BusinessBillEntity> list=businessBillDao.listbybill(businessBillInfoId);
		return list;
	}

	@Override
	public void deleteByInfoId(List<Long> ids) {
		businessBillDao.deleteBatchByInfoId(ids);
	}
    
    

}
